<template>
  <div class="footer-container">
    <!-- 全选按钮 -->
    <div class="custom-control custom-checkbox">
      <input type="checkbox" class="custom-control-input" id="fullCheck" :checked="isfull" @change="fullChange">
      <label class="custom-control-label" for="fullCheck">全选</label>
    </div>
    <!-- 合计 -->
    <div>
      <span>合计：</span>
      <span class="amount">&yen; {{ amount.toFixed(2) }}</span>
    </div>
    <!-- 结算 -->
    <button type="button" class="btn btn-primary btn-settle" :disabled="total === 0">结算（{{ total }}）</button>
  </div>
</template>

<script>
export default {
  name: 'EsFooter',
  emits: ['getFullChange'],
  props: {
    total: {
      type: Number,
      default: 0
    },
    amount: {
      type: Number,
      default: 0
    },
    isfull: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    fullChange(e) {
      this.$emit('getFullChange',e.target.checked)
    }
  }
}
</script>

<style lang="less" scoped>
  .footer-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: #fff;
    border-top: 1px solid #efefef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
  }
  .amount {
    font-weight: 700;
    color: red;
  }
  .btn-settle {
    width: 90px;
    height: 38px;
    border-radius: 19px;
  }
</style>